using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace ExcelSample {
    public partial class Inventory : Page {
        Populate p = new Populate ("new");

        protected void Page_Load (object sender, EventArgs e) {
            if (!Page.IsPostBack) {
                rbLaptops.Checked = true;
                p.QueryRange (ref gvResults, "*", "LaptopsRange");
                lblDebug.Text = "nothing checked";
            }
        }

        protected void rbLaptops_CheckedChanged (object sender, EventArgs e) {
            p.QueryRange (ref gvResults, "*", "LaptopsRange");
            lblDebug.Text = "Laptops Checked";
        }

        protected void rbDesktops_CheckedChanged (object sender, EventArgs e) {
            p.QueryRange (ref gvResults, "*", "DesktopsRange");
            lblDebug.Text = "Desktops Checked";
        }

        protected void gvResults_PageIndexChanging (object sender, GridViewPageEventArgs e) {
            if (gvResults.EditIndex != -1) {
                e.Cancel = true;
                lblDebug2.Text = "What?";
            } else {
                lblDebug2.Text = "what????";
            }
        }

        protected void gvResults_SelectedIndexChanged (object sender, EventArgs e) {
            lblDebug2.Text = "selected index changed";
        }
    }
}